import request from '@/utils/request'

// 查询产品类别工序列表
export function listProcess(query) {
  return request({
    url: '/sales/process/list',
    method: 'get',
    params: query
  })
}

// 查询列表（排除节点）
export function listProcessExcludeChild(processId) {
    return request({
      url: '/sales/process/list/exclude/' + processId,
      method: 'get'
    })
  }

// 查询产品类别工序详细
export function getProcess(processId) {
  return request({
    url: '/sales/process/' + processId,
    method: 'get'
  })
}

// 新增产品类别工序
export function addProcess(data) {
  return request({
    url: '/sales/process',
    method: 'post',
    data: data
  })
}

// 修改产品类别工序
export function updateProcess(data) {
  return request({
    url: '/sales/process',
    method: 'put',
    data: data
  })
}

// 删除产品类别工序
export function delProcess(processId) {
  return request({
    url: '/sales/process/' + processId,
    method: 'delete'
  })
}


// 计划编码状态修改
export function changeUserStatus(processId, status) {
    const data = {
      processId,
      status
    }
    return request({
      url: '/sales/process/changeStatus',
      method: 'put',
      data: data
    })
  }
